home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS11.ADF
/
AmigaBasicProgs
/
Calendar
/
calendar.main
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1986-08-05
|
29KB
|
1,179 lines
'Calendar Main Program Version 1.0 2-27-86
'Mark Hurst 503-843-3185
SCREEN 1,640,200,3,2
DEFINT a-z
WINDOW 1,"***** AMIGA CALENDAR *****",(0,0)-(250,40),0
COLOR 2,1:CLS
PRINT"BY Mark D. Hurst
PRINT TAB(6)"S.W. McKibben Rd.
PRINT TAB(6)"Sheridan Oregon 97378
PRINT TAB(6)"503-843-3185
DIM yearbuf(27),days.in.month(12),month$(12)
DIM char(50,26),num(50,10),symbol(102,4)
DIM code$(12),Lo(5,6),s(10),f$(10),f(5)
DIM cov.pat(3),r.edge.pat(3),b.edge.pat(3),reset.pat(3)
DIM change.pat(3),yb(42),a$(13),how(8)
FOR x=0 TO 8:READ how(x):NEXT x
DATA 110,0,150,0,22200,64,10,0,0
SAY TRANSLATE$("Just a Moment While i load some files."),how
FOR x=0 TO 3:READ r.edge.pat(x):NEXT x
DATA &h2222,&h2222,&h2222,&h2222
FOR x=0 TO 3:READ cov.pat(x):change.pat(x)=cov.pat(x):NEXT x
DATA &h7777, &hbbbb, &hdddd, &heeee
FOR x=0 TO 3:READ b.edge.pat(x):NEXT x
DATA 0,&hffff,0,&hffff
FOR x=0 TO 3:READ reset.pat(x):NEXT x
DATA -1,-1,-1,-1
FOR x=0 TO 42:READ yb(x):NEXT x
DATA 31,35,40,46,53,60,77,83,88,92,95,98,101,104
DATA 107,110,117,104,102,101,94
DATA 87,80,77,70,63,59,52,46
DATA 40,34,28,22,16,11,7,4,3,2,1,0,0,0
FOR x=1 TO 15:READ n!,d:SOUND n!,d:NEXT x
DATA 659.26,4,523 .25,8,587 .33,32,20 ,8,659 .26,4
DATA 523.25,8,587 .33,32,20 ,8,587 .33,24,783 .99,8
DATA 659.26,24,523 .25,8,587 .33,4,523 .25,8,587 .33,24
FOR x=0 TO 27:READ yearbuf(x):NEXT x
DATA 6,1,2,3,4,6,7,1,2,4,5,6,7,2,3,4,5,7,1,2,3,5,6,7,1,3,4,5
FOR x=1 TO 12:READ month$(x),days.in.month(x):NEXT x
DATA JANUARY,31,FEBRUARY,28,MARCH,31,APRIL,30
DATA MAY,31,JUNE,30,JULY,31,AUGUST,31
DATA SEPTEMBER,30,OCTOBER,31,NOVEMBER,30,DECEMBER,31
FOR x=1 TO 7:READ day.name$(x):NEXT x
DATA "Sunday ","Monday ","Tuesday "
DATA Wednesday,"Thursday ","Friday ","Saturday "
OPEN "16x16.num.set" FOR INPUT AS 1
FOR x=1 TO 10:FOR y=0 TO 50
num(y,x)=CVI(INPUT$(2,1))
NEXT y,x:CLOSE 1
OPEN "16x16.char.set" FOR INPUT AS 1
FOR x=1 TO 26:FOR y=0 TO 50
char(y,x)=CVI(INPUT$(2,1))
NEXT y,x:CLOSE 1
OPEN "cal.symbol" FOR INPUT AS 1
FOR x=1 TO 4:FOR y=0 TO 102
symbol(y,x)=CVI(INPUT$(2,1))
NEXT y,x:CLOSE 1
FOR x=1 TO 22:READ n!,d:SOUND n!,d:NEXT x
DATA 783.99,3,20 ,1,783 .99,3,20 ,1,783 .99,3
DATA 20,1,783 .99,3,880 ,4,20 ,4,743 ,8,659 .26,20
DATA 20,4,783 .99,3,20 ,1,783 .99,3,20 ,1,783 .99,3
DATA 20,1,783 .99,3,880 ,4,20 ,4,743 ,8
open.files:
OPEN "cal.data" AS 1 LEN=310
FIELD 1,300 AS c.dat$, 10 AS s.nam$
IF LOF(1)/310 <366 THEN GOSUB new.file
OPEN "cal.symbol.dat" AS 4 LEN=32
FIELD 4,32 AS cod$
FOR x=1 TO 12:GET 4:code$(x)=cod$:NEXT x
Skip4:
WINDOW 2,"Amiga Calendar",(0,0)-(564,186),16,1
WINDOW CLOSE 1
PALETTE 4,1,0,0 'red
PALETTE 5,0,0.7,0 'dk.green
PALETTE 6,0.8,0.6,0.53 'brown
PALETTE 7,1,0.7,0 'orange
draw.calendar: DIM b2(393)
COLOR 6,1
LINE (410,5)-(542,17),6,bf
COLOR 0,6
LOCATE 2,53:PRINT"PAYMENT SCEDULE""
GET (410,5)-(542,17),b2
COLOR 6,1:CLS
COLOR 5,1
LOCATE 3,2
FOR x=1 TO 19:READ n!,d:SOUND n!,d:NEXT x
DATA 659.26,20,20 ,4,783 .99,3,20 ,1,783 .99,3,20 ,1
DATA 783.99,3,20 ,1,783.99,3,880 ,4,20 ,4,743 ,8
DATA 659.26,8,587 .33,8,659 .26,8,743 ,4,659 .26,6
DATA 20,2,743,32
FOR x=1 TO 7
PRINT day.name$(x)" ";
NEXT x
get.current.date
draw.lines
put.date
find.buffers
fill.in.numbers
draw.menu:
LINE(20,174)-(0,180),4:LINE-(20,184),4
LINE(148,174)-(168,180),4:LINE-(148,184),4
LINE(20,174)-(148,184),4,b
LINE (60,174)-(60,184),4
LINE(108,174)-(108,184),4
PAINT (21,175),4:PAINT(147,175),4
LOCATE 23,4:COLOR 1,4:PRINT"LAST";TAB(15);"NEXT";
COLOR 4,1:LOCATE 23,9:PRINT"MONTH";
LINE(188,174)-(252,184),4,bf
LINE(260,174)-(300,184),4,bf
LINE(338,174)-(396,184),0,bf
LINE(402,174)-(458,184),0,bf
LINE(466,174)-(518,184),0,bf
LINE(522,174)-(562,184),0,bf
LOCATE 23,25:COLOR 1,4:PRINT"RESTORE";TAB(34);"JUMP";
COLOR 1,0
LOCATE 23,44:PRINT"UPDATE";TAB(52);"REMIND";TAB(60);"DIARY";TAB(67);"QUIT";
tx=184:COLOR 2,1
FOR x=1 TO 4:
LINE(tx,145)-(tx+18,160),0,bf
PUT(tx,145),symbol(0,x)
tx=tx+80
NEXT x
LOCATE 21,22:PRINT"BIRTHDAY";TAB(33);"BILLS";TAB(42);"MEETINGS";
PRINT TAB(53);"NOTES";TAB(62);"HOLIDAYS";
COLOR 4,1:LOCATE 19,64:PRINT"RED"
LOCATE 20,62:PRINT"NUMBERS"
LINE (1,167)-(559,167),4
PUT(432,0),b2
ERASE b2
put.day.symbols
mark.day
sw.type=0:how(7)=1
main.menu:
SAY TRANSLATE$("ready."),how
wait.for.mouse:
IF MOUSE(0)>-1 THEN SLEEP:GOTO wait.for.mouse
stay.1:
IF MOUSE(0)<0 THEN stay.1
IF MOUSE(1)>558 THEN BEEP:GOTO main.menu
'IF MOUSE(1)<150 AND MOUSE(2)<13 THEN GOSUB set.today.date:GOTO main.menu
IF MOUSE(1)>436 AND MOUSE(2)<13 THEN GOSUB payment.scedule:GOTO main.menu
IF MOUSE(2)<24 THEN BEEP:GOTO main.menu
'switch days and post.day
IF MOUSE(2)>23 AND MOUSE(2)<168 THEN
d=(INT((MOUSE(2)-24)/24)*7)+(INT((MOUSE(1)+1)/80))-month.marg+2
IF d<1 OR d>days.in.month(mo) THEN
BEEP:GOTO wait.for.mouse
ELSE
IF d=day THEN GOSUB post.day:GOTO main.menu
mark.day
day=d
mark.day
GOTO wait.for.mouse
END IF
END IF
'bottom menu items
IF MOUSE(2)>185 OR MOUSE(2)<175 THEN BEEP GOTO wait.for.mouse
IF MOUSE(1)<56 THEN GOSUB last.:GOTO main.menu
IF MOUSE(1)<108 THEN GOSUB switch:GOTO main.menu
IF MOUSE(1)<168 THEN GOSUB next.:GOTO main.menu
IF MOUSE(1)<272 THEN GOSUB restore.:GOTO main.menu
IF MOUSE(1)<300 THEN GOSUB jump:GOTO main.menu
IF MOUSE(1)<396 THEN GOSUB update:GOTO main.menu
IF MOUSE(1)<456 THEN GOSUB remind
IF MOUSE(1)<516 THEN GOSUB diary
CLOSE:SCREEN CLOSE 1:WINDOW 1:CLS:PRINT"Have a Nice Day"
SAY TRANSLATE$("have a nice day."):SYSTEM
END
switch:
IF sw.type THEN
sw.type=0:LOCATE 23,9
COLOR 4,1:PRINT"MONTH";
ELSE
sw.type=1:LOCATE 23,9
COLOR 4,1:PRINT"YEAR ";
END IF
stay.here:
IF MOUSE(0)<0 THEN stay.here
RETURN wait.for.mouse
next.:
IF sw.type=0 THEN
IF mo=12 THEN:mo=1:year=year+1:year$=MID$(STR$(year),2) :ELSE mo=mo+1
ELSE
year=year+1
year$=MID$(STR$(year),2)
END IF
GOTO new.screen
restore.:
IF year$=RIGHT$(DATE$,4) AND mo=VAL(LEFT$(DATE$,2)) THEN
IF day=VAL(MID$(DATE$,4,2)) THEN RETURN
mark.day
day=VAL(MID$(DATE$,4,2))
mark.day
RETURN
END IF
get.current.date
GOTO new.screen
jump: SAY TRANSLATE$("Jump to any calendar."),how
WINDOW 3,"Type in Date (MO/DY/YEAR)",(40,150)-(280,160),0,1
again:
LOCATE 1,15:LINE INPUT; d$
m=VAL(LEFT$(d$,2)):d=VAL(MID$(d$,4,2))
y$=MID$(d$,7):y=VAL(y$)
IF m<1 OR m>12 OR y<1 OR d<1 OR d>days.in.month(mo) THEN again:
IF y=year AND m=mo THEN
IF d=day THEN WINDOW CLOSE 3:RETURN main.menu
mark.day
day=d
mark.day
WINDOW CLOSE 3:RETURN main.menu
END IF
WINDOW CLOSE 3
day=d:mo=m:year=y:year$=y$
GOTO new.screen
last.:
IF sw.type=0 THEN
IF mo=1 THEN:mo=12:year=year-1:year$=MID$(STR$(year),2) :ELSE mo=mo-1
ELSE
year=year-1
year$=MID$(STR$(year),2)
END IF
new.screen:
clear.screen
draw.lines
put.date
find.buffers
fill.in.numbers
put.day.symbols
mark.day
RETURN
SUB get.current.date STATIC
SHARED mo,day,year$,year
mo=VAL(LEFT$(DATE$,2)):day=VAL(MID$(DATE$,4,2))
year$=RIGHT$(DATE$,4):year=VAL(year$)
END SUB
SUB mark.day STATIC
SHARED month.marg,day
WINDOW OUTPUT 2
v=INT((day+month.marg-2)/7)
h=((day-2+month.marg) MOD 7)
LOCATE v*3+4,h*10+2
c1=POINT(h*80+16,v*24+24)
c2=POINT(h*80+12,v*24+24)
COLOR c1,c2:PRINT MID$(STR$(day)+" ",2,2)
END SUB
SUB put.day.symbols STATIC
SHARED mo,days.in.month(),code$(),month.marg,symbol()
FOR x=1 TO days.in.month(mo)
IF MID$(code$(mo),x,1)<>CHR$(0) THEN
s=1:z=1:code=ASC(MID$(code$(mo),x,1))
FOR y=1 TO 5
IF code AND z THEN
IF y=5 THEN
v=INT((x+month.marg-2)/7)
h=((x-2+month.marg) MOD 7)
LOCATE v*3+4,h*10+2
COLOR 4,1:PRINT MID$(STR$(x)+" ",2,2)
ELSE
v=INT((x+month.marg-2)/7)*24+31
h=((x-2+month.marg) MOD 7)*80+s
LINE(h,v)-(h+18,v+15),0,bf
PUT(h,v),symbol(0,y)
s=s+20
END IF
END IF
z=z*2
NEXT y
END IF
NEXT x
END SUB
SUB clear.screen STATIC
LINE(0,23)-(160,167),1,bf
LINE(166,0)-(412,15),1,bf
LINE(161,23)-(560,143),1,bf
END SUB
SUB draw.lines STATIC
FOR x=0 TO 560 STEP 80
LINE (x,14)-(x,167),4
NEXT x
FOR x=23 TO 167 STEP 24
LINE (0,x)-(559,x),4
NEXT x
END SUB
SUB fill.in.numbers STATIC
SHARED mo,month.marg,days.in.month()
d=month.marg:y=4
IF month.marg=1 THEN COLOR 4,1 :ELSE COLOR 2,1
FOR x=1 TO days.in.month(mo)
IF d=2 THEN COLOR 2,1
LOCATE y,(d-1)*10+2:PRINT MID$(STR$(x),2)
d=d+1:IF d=8 THEN y=y+3:COLOR 4,1:d=1
NEXT x
END SUB
SUB find.buffers STATIC
SHARED total.d,mo,year,days.in.month()
SHARED yearbuf(),leap.buf,month.marg
total.d=0
IF mo=1 THEN skip1
IF year/4=INT(year/4) THEN
days.in.month(2)=29:leap.buf=0
ELSE
days.in.month(2)=28:leap.buf=1
END IF
FOR x=1 TO mo-1
total.d=total.d + days.in.month(x)
NEXT x
skip1:
month.marg=total.d-(INT(total.d/7)*7)+yearbuf(year MOD 28)
IF month.marg>7 THEN month.marg=month.marg-7
END SUB
SUB put.date STATIC
SHARED month$(),year$
SHARED mo,char(),num()
LINE(166,0)-(LEN(month$(mo))*16+165,15),0,bf
FOR x=1 TO LEN(month$(mo))
c=ASC(MID$(month$(mo),x,1))-64
PUT (x*16+150,0),char(0,c)
NEXT x
LINE(326,0)-(LEN(year$)*16+325,15),0,bf
FOR x=1 TO LEN(year$)
n=ASC(MID$(year$,x,1))-47
IF n<1 OR n>10 THEN skip5
PUT (310+(x*16),0),num(0,n)
skip5:
NEXT x
END SUB
post.day: SAY TRANSLATE$("post data."),how
no.input=1
d$= month$(mo)+STR$(day)+","+year$+" Calendar Input Screen"
WINDOW 3,d$,(0,0)-(564,186),0,1
COLOR 2,3:CLS
LINE(284,0)-(284,186),2:LINE(0,71)-(564,71),2
LINE(0,143)-(564,143),2
put.bold.char "BIRTHDAYS",66,0
put.bold.char "BILLS",384,0
put.bold.char "MEETINGS",78,72
put.bold.char "NOTES",384,72
put.bold.char "HOLIDAY",86,144
put.bold.char "EXIT",392,144
LOCATE 3,4:PRINT "Name";TAB(28);"Year";TAB(38);"Pay To";TAB(58);"Amount"
LOCATE 12,3:PRINT"What?";TAB(15);"Where?";TAB(27);"When?"
LOCATE 21,6:PRINT"Name";TAB(22);"Permanent?";
'get data & put
rec=total.d+day
IF rec> 59 THEN rec=rec+leap.buf
GOSUB get.data
COLOR 0,3
put.on.screen: ERASE Lo:DIM Lo(6,5)
FOR x=1 TO 10
IF s(x)>0 THEN
ON s(x) GOSUB p.birth,p.bill,p.meet,p.note,p.holi
ELSE
f$(x)=SPACE$(30)
END IF
NEXT x
day.menu:
LOCATE 23,45:COLOR 2,4:PRINT"MAKE A SELECTION";
repeat:
IF MOUSE(0)>-1 THEN SLEEP:GOTO repeat
LOCATE 23,45:COLOR 0,3:PRINT SPACE$(16);
IF MOUSE(1)<284 AND MOUSE(2)<72 THEN GOSUB i.birth
IF MOUSE(1)>283 AND MOUSE(2)<72 THEN GOSUB i.bill
IF MOUSE(1)<284 AND MOUSE(2)>143 THEN GOSUB i.holiday
IF MOUSE(1)>283 AND MOUSE(2)>143 THEN exit.input
IF MOUSE(1)<284 THEN GOSUB i.meet
IF MOUSE(1)>283 THEN GOSUB i.note
end.of.menu:
IF flag=1 THEN
ON t GOSUB clear1,clear2,clear3,clear4,clear5
FOR x=1 TO 10
IF s(x)=t THEN
ON s(x) GOSUB p.birth,p.bill,p.meet,p.note,p.holi
END IF
NEXT x
END IF
flag=0
GOTO day.menu
SUB put.bold.char (word$,topx,topy) STATIC
SHARED char()
'LINE(topx,topy)-(LEN(word$)*16+topx-1,topy+15),0,bf
FOR x=0 TO LEN(word$)-1
c=ASC(MID$(word$,x+1,1))-64
PUT (x*16+topx,topy),char(0,c)
NEXT x
END SUB
i.holiday:
IF Lo(5,0)=0 THEN
find.next.open next.o
IF flag=2 THEN RETURN end.of.menu
n=next.o:flag=3:input.data 5,22,1,1,27,1,n
ELSE
n=Lo(5,1)
input.data 5,22,1,1,27,1,n
END IF
IF flag=1 THEN RETURN end.of.menu
input.again:
LOCATE 22,28:PRINT"y/n";:a$=INPUT$(1)
IF UCASE$(a$)="Y" THEN
MID$(f$(n),28)="YES"
ELSEIF UCASE$(a$)="N" THEN
MID$(f$(n),28)="NO "
ELSE
GOTO input.again:
END IF
LOCATE 22,28:PRINT RIGHT$(f$(n),3)+" "
RETURN end.of.menu
i.birth:
IF MOUSE(2)>23 AND MOUSE(2)<Lo(1,0)*8+23 THEN 'edit
p=INT(MOUSE(2)/8)-2
IF MOUSE(1)<204 THEN input.data 1,3+p,1,1,26,p,Lo(1,p) :ELSE input.data 1,3+p,28,27,4,p,Lo(1,p)
ELSE
find.next.open next.o
IF flag<>2 THEN
input.data 1,Lo(1,0)+4,1,1,26,Lo(1,0)+1,next.o
IF flag=1 THEN RETURN end.of.menu
flag=3
input.data 1,Lo(1,0)+4,28,27,4,Lo(1,0)+1,next.o
END IF
END IF
RETURN end.of.menu
i.bill:
IF MOUSE(2)>23 AND MOUSE(2)<Lo(2,0)*8+23 THEN 'edit
p=INT(MOUSE(2)/8)-2
IF MOUSE(1)<448 THEN input.data 2,3+p,37,1,20,p,Lo(2,p) :ELSE input.data 2,3+p,58,21,10,p,Lo(2,p)
ELSE
find.next.open next.o
IF flag<>2 THEN
input.data 2,Lo(2,0)+4,37,1,20,Lo(2,0)+1,next.o
IF flag=1 THEN RETURN end.of.menu
flag=3
input.data 2,Lo(2,0)+4,58,21,10,Lo(2,0)+1,next.o
END IF
END IF
RETURN end.of.menu
i.meet:
IF MOUSE(2)>95 AND MOUSE(2)<Lo(3,0)*8+95 THEN
p=INT(MOUSE(2)/8)-11
IF MOUSE(1)<99 THEN
input.data 3,12+p,1,1,12,p,Lo(3,p)
ELSEIF MOUSE(1)<195 THEN
input.data 3,12+p,14,13,12,p,Lo(3,p)
ELSE
input.data 3,12+p,27,25,6,p,Lo(3,p)
END IF
ELSE
find.next.open next.o
IF flag<>2 THEN
input.data 3,Lo(3,0)+13,1,1,12,Lo(3,0)+1,next.o
IF flag=1 THEN RETURN end.of.menu
input.data 3,Lo(3,0)+13,14,13,12,Lo(3,0)+1,next.o
IF flag=1 THEN RETURN end.of.menu
flag=3
input.data 3,Lo(3,0)+13,27,25,6,Lo(3,0)+1,next.o
END IF
END IF
RETURN end.of.menu
i.note:
IF MOUSE(2)>95 AND MOUSE(2)<Lo(4,0)*8+95 THEN 'edit
p=INT(MOUSE(2)/8)-11
input.data 4,12+p,37,1,30,p,Lo(4,p)
ELSE
find.next.open next.o
IF flag<>2 THEN flag=3:input.data 4,Lo(4,0)+13,37,1,30,Lo(4,0)+1,next.o
END IF
RETURN end.of.menu
SUB input.data (type,px,py,fpos,length,tpos,no) STATIC
SHARED s(),Lo(),f$(),flag,no.input,t
IF tpos>5 THEN BEEP:EXIT SUB
no.input=0:c=4:p=1:GOSUB putcursor
word$=MID$(f$(no),fpos,length)
getkey: a$=INKEY$
WHILE a$="":a$=INKEY$
IF MOUSE(0)<0 THEN exit.sub
WEND
IF a$<CHR$(127) AND a$>CHR$(31) THEN
IF p>length THEN BEEP:GOTO getkey
MID$(word$,p,1)=a$:LOCATE px,py:PRINT word$
p=p+1:c=4:GOSUB putcursor
GOTO getkey
END IF
IF a$=CHR$(127) THEN
flag=1:s(no)=0:Lo(type,0)=0:t=type
f$(no)=STRING$(30,32)
EXIT SUB
END IF
IF a$=CHR$(13) THEN
exit.sub:
MID$(f$(no),fpos,length)=word$
IF flag=3 THEN s(no)=type:Lo(type,tpos)=no:Lo(type,0)=Lo(type,0)+1
c=3:GOSUB putcursor
EXIT SUB
END IF
IF a$=CHR$(8) THEN
IF p>1 THEN
IF p=>length THEN c=3:GOSUB putcursor
p=p-1
word$=LEFT$(word$,p-1)+MID$(word$,p+1)+" "
LOCATE px,py:PRINT word$
c=4:GOSUB putcursor:GOTO getkey
ELSE
BEEP:GOTO getkey
END IF
END IF
IF a$=CHR$(30) THEN
IF p>length THEN BEEP:GOTO getkey
c=3:GOSUB putcursor:p=p+1:c=4:GOSUB putcursor
GOTO getkey
END IF
IF a$=CHR$(31) THEN
IF p=1 THEN BEEP:GOTO getkey
c=3:GOSUB putcursor:p=p-1:c=4:GOSUB putcursor
GOTO getkey
END IF
BEEP:GOTO getkey
putcursor:
LINE((py+p-2)*8,(px-1)*8)-((py+p-2)*8,(px-1)*8+6),c
RETURN
END SUB
SUB find.next.open (n) STATIC
SHARED flag,s()
FOR n=1 TO 10:IF s(n)=0 THEN EXIT SUB
NEXT n
BEEP:flag=2
END SUB
clear1: LINE (0,24)-(283,70),3,bf:RETURN
clear2: LINE (285,24)-(564,70),3,bf:RETURN
clear3: LINE (0,96)-(283,142),3,bf:RETURN
clear4: LINE (285,96)-(564,142),3,bf:RETURN
clear5: LINE (0,168)-(283,178),3,bf:RETURN
p.birth:
Lo(1,0)=Lo(1,0)+1:LOCATE Lo(1,0)+3,1
PRINT LEFT$(f$(x),25)" "RIGHT$(f$(x),5)
Lo(1,Lo(1,0))=x:RETURN
p.bill:
Lo(2,0)=Lo(2,0)+1:LOCATE Lo(2,0)+3,37
PRINT LEFT$(f$(x),20)" "RIGHT$(f$(x),10)
Lo(2,Lo(2,0))=x:RETURN
p.meet:
Lo(3,0)=Lo(3,0)+1:LOCATE Lo(3,0)+12,1
PRINT LEFT$(f$(x),12)" "MID$(f$(x),13,12)" "RIGHT$(f$(x),6)
Lo(3,Lo(3,0))=x:RETURN
p.note:
Lo(4,0)=Lo(4,0)+1:LOCATE Lo(4,0)+12,37
PRINT f$(x)
Lo(4,Lo(4,0))=x:RETURN
p.holi: LOCATE 22,1
PRINT f$(x):Lo(5,0)=1:Lo(5,1)=x
RETURN
exit.input:
WINDOW CLOSE 3
IF no.input THEN skip6
code=0:z=1:s=1
v=INT((day+month.marg-2)/7)*24+31
h=((day-2+month.marg) MOD 7)*80+1
LINE(h,v)-(h+78,v+15),1,bf
FOR y=1 TO 5
IF Lo(y,0) THEN
code=code+z
IF y=5 THEN
calc.pos v,h
LOCATE v*3+4,h*10+2
COLOR 1,4:PRINT MID$(STR$(day)+" ",2,2)
ELSE
calc.pos v,h
v=v*24+31
h=h*80+s
LINE(h,v)-(h+18,v+15),0,bf
PUT(h,v),symbol(0,y)
s=s+20
END IF
ELSEIF y=5 AND h>1 THEN
calc.pos v,h
LOCATE v*3+4,h*10+2
COLOR 1,2:PRINT MID$(STR$(day)+" ",2,2)
ELSEIF y=5 AND h<2 THEN
calc.pos v,h
LOCATE v*3+4,2
COLOR 1,4:PRINT MID$(STR$(day)+" ",2,2)
END IF
z=z*2
NEXT y
MID$(code$(mo),day,1)=CHR$(code)
LSET cod$=code$(mo):PUT #4,mo
GOSUB set.data:PUT 1,rec
skip6:
RETURN main.menu
SUB calc.pos (v,h) STATIC
SHARED day,month.marg
v=INT((day+month.marg-2)/7)
h=((day-2+month.marg) MOD 7)
END SUB
update: SAY TRANSLATE$("update data for last thirty days."),how
GOSUB restore.
d$= month$(mo)+STR$(day)+","+year$+" UPDATE LAST 30 DAYS"
WINDOW 3,d$,(16,70)-(544,126),0,1
COLOR 7,2:CLS
d=day:m=mo:y=year:rec=total.d+d
marg=month.marg+day-1:p=0:flag=0
IF rec>59 THEN rec=rec+leap.buf
FOR x=30 TO 0 STEP -1
IF rec=60 THEN rec=rec-leap.buf
IF d=0 THEN
m=m-1
IF m=0 THEN m=12:y=y-1:rec=366
d=days.in.month(m)
END IF
IF ASC(MID$(code$(m),d,1))>1 THEN
GOSUB get.data
dat$=month$(m)+STR$(d)+","+STR$(year)
FOR z=1 TO 10
IF s(z)>1 THEN
nam$=f$(z)
flag=1:CLS
ON s(z)-1 GOSUB u.bill,u.meet,u.note,u.holiday
END IF
NEXT z
END IF
IF w.flag THEN
w.flag=0:code=0
ERASE f:DIM f(5)
FOR z=1 TO 10:IF s(z) THEN f(s(z))=1
NEXT z
GOSUB set.data
v=1:FOR f=1 TO 5:code=code+(v*f(f)):v=v*2:NEXT f
MID$(code$(m),d,1)=CHR$(code)
LSET cod$=code$(m):PUT #4,m
END IF
d=d-1:rec=rec-1
NEXT x :IF flag=0 THEN PRINT"Everything Was Up To Date" :ELSE flag=0
PRINT"Checking Payment Scedules . . ."
OPEN "pay.scedule" AS 5 LEN=39
FIELD 5, 20 AS pay.to$,10 AS amt$,2 AS day$,7 AS lp$
np$=SPACE$(18)
FOR x=1 TO 18:GET 5
IF VAL(day$)=0 THEN MID$(np$,x,1)="0" :ELSE MID$(np$,x,1)="1"
NEXT x
GOSUB ps.exit
GOTO new.screen
u.bill: GOSUB head.1:GOSUB print.1
PRINT"Did You Pay This Bill ? (y/n)";
get.answer:
a$=UCASE$(INPUT$(1))
IF a$="Y" THEN w.flag=1:s(z)=0:f$(z)="":RETURN
IF a$="N" THEN RETURN
LOCATE 4,1:PRINT"COME ON NOW, GIVE ME A STRAIGHT ANSWER !!
GOTO get.answer
u.meet: PRINT"Deleting Meeting . . . "
GOSUB print.2:w.flag=1:s(z)=0:f$(z)=""
FOR pause=0 TO 5000:NEXT pause
RETURN
u.note: PRINT dat$
PRINT "Did You ... ";f$(z);"? (y/n)"
a$=UCASE$(INPUT$(1))
IF a$="Y" THEN w.flag=1:s(z)=0:f$(z)="":RETURN
IF a$="N" THEN RETURN
LOCATE 4,1:PRINT"I HOPE YOU DID IT BETTER THAN YOU ARE PRESSING KEYS ... TRY AGAIN"
GOTO get.answer
u.holiday:
IF RIGHT$(f$(z),3)="YES" THEN RETURN
PRINT"Deleting Holiday . . .":PRINT dat$
PRINT LEFT$(f$(z),27):s(z)=0:f$(z)="":w.flag=1
FOR pause=0 TO 7000:NEXT pause
RETURN
remind: SAY TRANSLATE$("Reminders for the next thirty days."),how
GOSUB restore.
d$= month$(mo)+STR$(day)+","+year$+" REMINDERS FOR THE NEXT 30 DAYS"
WINDOW 3,d$,(0,0)-(504,186),0,1
COLOR 0,7:CLS:SAY TRANSLATE$("birthdays."),how
put.bold.char "BIRTHDAYS",172,0
PUT (136,0),symbol(0,1)
PUT (336,0),symbol(0,1)
LOCATE 3,4:PRINT "Name":LOCATE 3,28:PRINT"Day Name"
LOCATE 3,39:PRINT"Date":LOCATE 3,57:PRINT"Born"
d=day:m=mo:y=year:rec=total.d+d
marg=month.marg+day-1:p=0:flag=0
IF rec>59 THEN rec=rec+leap.buf
OPEN "ram:temp" AS 5 LEN=58
FIELD 5, 30 AS nam$,1 AS type$,27 AS dat$
FOR x=0 TO 30
IF rec=60 THEN rec=rec+leap.buf
IF d>days.in.month(m) THEN d=1:m=m+1
IF m>12 THEN m=1:y=y+1:rec=1
IF ASC(MID$(code$(m),d,1))>0 THEN
GOSUB get.data
FOR z=1 TO 10
IF s(z)>0 THEN
IF s(z)=1 THEN
flag=1
PRINT LEFT$(f$(z),26)" ";
PRINT day.name$(((marg+x-1) MOD 7)+1)" ";
PRINT USING"\ \";month$(m)+STR$(d)+","+STR$(year);
PRINT RIGHT$(f$(z),4)
p=p+1:IF p>18 THEN wait.for.key:p=0:CLS
ELSE
LSET nam$=f$(z):LSET type$=CHR$(s(z))
IF x=0 THEN
LSET dat$="TODAY"
ELSEIF x=1 THEN
LSET dat$="TOMORROW"
ELSE
LSET dat$=day.name$(((marg+x-1) MOD 7)+1)+" "+month$(m)+STR$(d)+","+STR$(year)
END IF
PUT 5
END IF
END IF
NEXT z
END IF
d=d+1:rec=rec+1
NEXT x :IF flag=0 THEN PRINT"None Recorded" :ELSE flag=0
wait.for.key
FOR x=2 TO 5
CLS:p=0:total#=0
ON x-1 GOSUB head.1,head.2,head.3,head.4
IF x<>5 THEN PUT (136,0),symbol(0,x):PUT (336,0),symbol(0,x)
FOR r=1 TO LOF(5)/58
GET 5,r
IF x=ASC(type$) THEN
flag=1
p=p+1:IF p=19 THEN wait.for.key:p=0:CLS
ON x-1 GOSUB print.1,print.2,print.3,print.4
END IF
NEXT r
IF flag=0 THEN
PRINT"None Recorded"
ELSE
flag=0
IF x=2 THEN PRINT USING"Total Bills Due $$#######.##";total#
END IF
wait.for.key
NEXT x
CLOSE 5:KILL"ram:temp"
WINDOW CLOSE 3:RETURN main.menu
head.1: put.bold.char "BILLS",204,0
SAY TRANSLATE$("bills."),how
LOCATE 3,4:PRINT"Pay To";TAB(28);"Amount";TAB(47);"Due Date"
RETURN
print.1: PRINT LEFT$(nam$,20)" ";
PRINT USING"$$#######.## ";VAL(RIGHT$(nam$,10));
PRINT dat$
total#=total#+VAL(RIGHT$(nam$,10))
RETURN
head.2: put.bold.char "MEETINGS",188,0
SAY TRANSLATE$("meetings."),how
LOCATE 3,4:PRINT"What ?";TAB(16);"Where ?";TAB(37);"When ?"
RETURN
print.2: PRINT LEFT$(nam$,12)" ";
PRINT MID$(nam$,13,12)" ";:PRINT RIGHT$(nam$,6);
PRINT dat$
RETURN
head.3: put.bold.char "NOTES",204,0
SAY TRANSLATE$("notes."),how
LOCATE 3,4:PRINT"Don't Forget to .......";;TAB(36);"Date"
RETURN
print.3: PRINT nam$;dat$:RETURN
head.4: put.bold.char "HOLIDAYS",188,0
SAY TRANSLATE$("holidays"),how
LOCATE 3,19:PRINT"Permanent ?"
RETURN
print.4: PRINT nam$;dat$:RETURN
diary: SAY TRANSLATE$("dire e."),how
WINDOW 3,"D I A R Y",(0,0)-(564,186),0,1
COLOR 1,6:CLS
PATTERN &Hffff,cov.pat
COLOR 2,5:LINE (180,20)-(520,150),2,bf
PATTERN &Hffff,r.edge.pat:COLOR 1,6
COLOR 1,7:AREA(522,25):AREA(540,41):AREA(540,165)
AREA(522,150):AREAFILL
PATTERN &Hffff,b.edge.pat
AREA(522,151):AREA(537,163):AREA(198,163)
AREA(182,151):AREAFILL
LINE (536,38)-(539,38),2:LINE (180,20)-(520,150),2,b
LINE(540,38)-(541,164),2,b:LINE(200,164)-(541,164),2
LINE(200,164)-(180,150),2:LINE(199,164)-(179,150),2
LINE(179,20)-(179,150),2:LINE(519,20)-(519,150),2
put.bold.char "DIARY",274,50
put.bold.num 370,50
diary.date$=" "+day.name$(((month.marg+day-2) MOD 7)+1)+" "+month$(mo)+STR$(day)+","+year$+" "
t.code$=CHR$(mo)+CHR$(day)
OPEN "diary.data"+year$ AS 5 LEN=520
FIELD 5,520 AS d.dat$
OPEN "diary.index"+year$ AS 6 LEN=2
FIELD 6,2 AS f.code$
IF LOF(6)<2 THEN
i.rec=1
FOR x=1 TO 13:a$(x)=STRING$(40,32):NEXT x
GOTO open.book
END IF
FOR i.rec=1 TO LOF(6)/2:GET 6
IF f.code$=t.code$ THEN
GET 5,i.rec
FOR x=0 TO 12:a$(x+1)=MID$(d.dat$,x*40+1,40):NEXT x
GOTO open.book
END IF
NEXT i.rec: FOR x=1 TO 13:a$(x)=STRING$(40,32):NEXT x
open.book: PATTERN &Hffff,cov.pat
y!=20:x2=0:c=0:y1=16:p=42
FOR x=508 TO 180 STEP-8
y!=y!-4:y2=y!+130
IF y!<1 THEN y1=0::x2=x-yb(c):c=c+1 :ELSE y1=CINT(y!):x2=x
IF y2<21 THEN y3=21 :ELSE y3=y2
IF y2<0 THEN y2=0
COLOR 2,5
AREA(x,y1):AREA(x,y2):AREA (180,150)
AREA(180,20):AREA(x2,y1):AREAFILL
COLOR 1,1
AREA(x+1,y3):AREA(180,150):AREA(x+12,150)
AREA(x+12,24):AREA(x+1,24):AREAFILL
COLOR 6,6
AREA (x,y1):AREA(x,23):AREA(520,23):AREA(520,0)
AREAFILL
IF p<41 AND p>0 THEN
COLOR 5,1
LOCATE 4,p+24:PRINT MID$(diary.date$,p,2);
COLOR 0,1:LOCATE 6,1
FOR dp=1 TO 13
PRINT TAB(p+23);MID$(a$(dp),p,1)
NEXT dp
END IF
p=p-1
NEXT x :c=36
FOR x=172 TO 8 STEP -8
y!=y!+4:y2=y!+130
IF y1<1 THEN y1=0::x2=x+yb(c)+10:c=c-1 :ELSE y1=CINT(y!):x2=x
IF y2<21 THEN y3=21 :ELSE y3=y2
IF y2<0 THEN y2=0
COLOR 2,4
AREA(x,y1):AREA(x,y2):AREA (180,152)
AREA(180,20):AREA(x2,y1):AREAFILL
COLOR 6,6
AREA (180,20):AREA(180,0):AREA(x2,0)
AREAFILL
FOR pause=0 TO 200:NEXT pause
NEXT x
LINE(x+7,y1)-(x+7,y2),2:LINE-(180,152),2
LINE-(180,20),2:LINE-(x2,y1),2:LINE-(x+7,y1),2
put.bold.char "EXIT",232,170
COLOR 0,1
flag=0
get.d.text 13,6,24,40,a$(),4,1
IF flag=1 THEN
LSET f.code$=t.code$
PUT 6, i.rec
a$="":FOR x=1 TO 13:a$=a$+a$(x):NEXT x
LSET d.dat$=a$
PUT 5,i.rec
END IF
CLOSE 5:CLOSE 6:WINDOW CLOSE 3
RETURN main.menu
END
SUB put.bold.num (topx,topy) STATIC
SHARED num(),year$
FOR x=1 TO LEN(year$)
n=ASC(MID$(year$,x,1))-47
IF n<1 OR n>10 THEN skip8
PUT ((topx-16)+(x*16),topy),num(0,n)
skip8:
NEXT x
END SUB
SUB wait.for.key STATIC
SHARED how()
LOCATE 23,20:PRINT"PRESS ANY KEY OR MOUSE TO CONTINUE";
SAY TRANSLATE$("hit a key."),how
keep.waiting:
a$=INKEY$:IF a$="" AND MOUSE(0)>-1 THEN SLEEP:GOTO keep.waiting
LOCATE 23,20:PRINT SPACE$(25);
END SUB
get.data: GET 1,rec
FOR r=1 TO 10
f$(r)=MID$(c.dat$,r*30-29,30)
s(r)=ASC(MID$(s.nam$,r,1))
NEXT r
RETURN
set.data: c$="":s$=""
FOR r=1 TO 10
c$=c$+f$(r):s$=s$+CHR$(s(r))
NEXT r
LSET c.dat$=c$:LSET s.nam$=s$
PUT 1,rec
RETURN
SUB get.d.text(lines,topx,topy,wide,a$(),cur,bc) STATIC
SHARED flag
l=1:p=1:c=cur
GOSUB putcur
getk:
IF MOUSE(0)<0 THEN
IF MOUSE(2)<(topx+lines-1)*8 AND MOUSE(2)>(topx-1)*8 AND MOUSE(1)>(topy-1)*8 AND MOUSE(1)<(topy+wide)*8 THEN
c=bc:GOSUB putcur:c=cur
p=INT(MOUSE(1)/8)-topy+2
l=INT(MOUSE(2)/8)-topx+2
GOSUB putcur
ELSEIF MOUSE(2)>170 AND MOUSE(2)<186 AND MOUSE(1)>232 AND MOUSE(1)<296 THEN
EXIT SUB
ELSE
BEEP
END IF
END IF
a$=INKEY$
IF a$="" THEN SLEEP:GOTO getk
IF a$=CHR$(13) THEN
IF l=lines THEN BEEP:GOTO getk
c=bc:GOSUB putcur:c=cur
p=1:l=l+1:GOTO 100
END IF
IF a$=CHR$(8) THEN
IF p>1 THEN
c=bc:GOSUB putcur:c=cur
p=p-1
a$(l)=LEFT$(a$(l),p-1)+MID$(a$(l),p+1)+" "
LOCATE topx+l-1,topy
PRINT a$(l)
GOTO 100
ELSEIF l<>1 THEN
c=bc:GOSUB putcur:c=cur:l=l-1:p=wide
a$(l)=LEFT$(a$(l),wide-1)+" "
LOCATE topx+l-1,topy
PRINT a$(l)
GOTO 100
ELSE
BEEP:GOTO getk
END IF
END IF
ON INSTR(CHR$(28)+CHR$(29)+CHR$(30)+CHR$(31),a$)GOTO up,down,right,left
IF p>wide THEN
IF l=lines THEN BEEP:GOTO getk
c=bc:GOSUB putcur:c=cur:GOSUB find.last.32
IF ls<40 AND a$<>CHR$(32) THEN
c=bc:GOSUB putcur:c=cur
chop$=RIGHT$(a$(l),wide-ls)
a$(l)=LEFT$(a$(l),ls)+SPACE$(wide-ls)
LOCATE topx+l-1,topy:PRINT a$(l)
l=l+1:p=LEN(chop$)+1
a$(l)=chop$+LEFT$(a$(l),wide-LEN(chop$))
LOCATE topx+l-1,topy:PRINT a$(l)
ELSE
l=l+1:p=1
END IF
END IF
flag=1
MID$(a$(l),p,1)=a$
LOCATE topx+l-1,topy+p-1
PRINT a$;
p=p+1
100 :
GOSUB putcur
GOTO getk
up:
IF l=1 THEN BEEP:GOTO getk
c=bc:GOSUB putcur:c=cur
l=l-1:GOTO 100
down:
IF l=lines THEN BEEP:GOTO getk
c=bc:GOSUB putcur:c=cur
l=l+1:GOTO 100
right:
IF p>wide THEN
IF l=lines THEN BEEP:GOTO getk
c=bc:GOSUB putcur:c=cur:l=l+1:p=1:GOTO 100
END IF
c=bc:GOSUB putcur:c=cur
p=p+1:GOTO 100
left:
IF p=1 THEN
IF l=1 THEN BEEP:GOTO getk
c=bc:GOSUB putcur:c=cur:l=l-1:p=wide:GOTO 100
END IF
c=bc:GOSUB putcur:c=cur
p=p-1:GOTO 100
putcur:
LINE((topy+p-2)*8,(topx+l-2)*8)-((topy+p-2)*8,(topx+l-2)*8+6),c
RETURN
find.last.32: ps=0
find: ls=ps:ps=INSTR(ps+1,a$(l)," ")
IF ps=0 THEN RETURN
GOTO find
END SUB
payment.scedule: SAY TRANSLATE$("payment scedule."),how
GOSUB restore.
WINDOW 3,"Payment Scedules",(120,0)-(496,186),0,1
COLOR 1,7:CLS
LOCATE 1,34:PRINT"LAST PAYMENT"
LOCATE 2,1:PRINT" PAY TO AMOUNT DAY (MO/YEAR)"
np$=STRING$(18,"0")
OPEN "pay.scedule" AS 5 LEN=39
FIELD 5, 20 AS pay.to$,10 AS amt$,2 AS day$,7 AS lp$
IF LOF(5)=0 THEN
LSET pay.to$=STRING$(20,32):LSET amt$=STRING$(10,32)
LSET day$=" ":LSET lp$=" "
FOR x=1 TO 18:PUT 5:NEXT x
GOTO pay.menu
END IF
LOCATE 3,1:COLOR 2,7
FOR x=1 TO 18:GET 5
PRINT pay.to$" "amt$" "day$" "lp$
IF day$=" " THEN MID$(np$,x,1)="0" :ELSE MID$(np$,x,1)="1"
NEXT x
put.bold.char "EXIT",168,170
pay.menu:
LOCATE 1,10:COLOR 0,5:PRINT"MAKE A SELECTION";
repeat2:
IF MOUSE(0)>-1 THEN repeat2
LOCATE 1,10:COLOR 2,7:PRINT SPACE$(16);
IF MOUSE(1)<352 AND MOUSE(1)>0 THEN
IF MOUSE(2)>16 THEN IF MID$(np$,INT(MOUSE(2)/8)-1,1)="1" THEN GOSUB ps.edit
END IF
IF MOUSE(2)>170 AND MOUSE(1)>168 AND MOUSE(1)<232 THEN GOTO ps.exit
GOSUB ps.input
ps.input: px=INSTR(np$,"0"):h=px+2
IF px=0 THEN BEEP:RETURN pay.menu
a$(1)=STRING$(20,32)
input.ps h,1,20,a$(1) 'name
IF flag=1 THEN MID$(np$,px,1)="0":RETURN pay.menu
a$(2)=STRING$(10,32)
input.ps h,22,10,a$(2) 'amount
IF flag=1 THEN MID$(np$,px,1)="0":RETURN pay.menu
day.again:
a$(3)=STRING$(2,32)
input.ps h,33,2,a$(3) 'day
IF flag=1 THEN MID$(np$,px,1)="0":RETURN pay.menu
d=VAL(a$(3))
IF d>28 OR d<1 THEN BEEP:GOTO day.again
mo.year.again:
a$(4)=STRING$(7,32)
input.ps h,37,7,a$(4) 'mo/year
IF flag=1 THEN MID$(np$,px,1)="0":RETURN pay.menu
m=VAL(LEFT$(a$(4),2))
IF m>12 OR m<1 THEN BEEP:GOTO mo.year.again
put.in.file:
LSET pay.to$=a$(1):LSET amt$=a$(2)
LSET day$=a$(3):LSET lp$=a$(4):PUT 5,px
MID$(np$,px,1)="1"
RETURN pay.menu
ps.edit: px=INT(MOUSE(2)/8)+1:h=INT(MOUSE(1)/8)
rec=px-2:GET 5,rec
a$(1)=pay.to$:a$(2)=amt$:a$(3)=day$:a$(4)=lp$
IF h<21 THEN
py=1:x=1:l=20
ELSEIF h<32 THEN
py=22:x=2:l=10
ELSEIF h<36 THEN
py=33:x=3:l=2
ELSE
py=37:x=4:l=7
END IF
a$(x)=SPACE$(l)
edit.again:
input.ps px,py,l,a$(x)
IF flag=1 THEN
LSET pay.to$=" ":LSET amt$=" "
LSET day$=" ":LSET lp$=" ":PUT 5,px
MID$(np$,rec,1)="0"
RETURN pay.menu
END IF
IF x=3 THEN
IF VAL(a$(3))>28 OR VAL(a$(3))<1 THEN edit.again
END IF
IF x=4 THEN
IF VAL(LEFT$(a$(4),2))>12 OR VAL(LEFT$(a$(4),2))<1 THEN edit.again
END IF
GOTO put.in.file
ps.exit:
LOCATE 22,1:PRINT SPACE$(40)
PRINT" Posting Payment Scedule on Calendar ";
psexit:
FOR ps=1 TO 18
IF MID$(np$,ps,1)="1" THEN
GET 5,ps
FOR check.mo=9 TO 0 STEP -1
m=((mo+check.mo) MOD 12)+1:d=VAL(day$)
IF d>day AND check.mo=0 THEN next.ps
IF mo>m THEN y=year+1 :ELSE y=year
find.rec m,d,y
GOSUB get.data
IF ASC(MID$(code$(m),d,1)) AND 2 THEN
FOR x=1 TO 10
IF s(x)=2 THEN
IF LEFT$(f$(x),20)=pay.to$ THEN next.ps
END IF
NEXT x
ELSE
MID$(code$(m),d,1)=CHR$(ASC(MID$(code$(m),d,1))+2)
LSET cod$=code$(m):PUT 4,m
END IF
x=1
WHILE s(x)<>0 AND x<11
x=x+1
WEND
f$(x)=pay.to$+amt$:s(x)=2:GOSUB set.data
NEXT check.mo
END IF
next.ps:
NEXT ps
CLOSE 5:WINDOW CLOSE 3
RETURN
SUB find.rec (mo,day,year) STATIC
SHARED days.in.month(),rec
rec=0
IF year/4=INT(year/4) THEN leap.buf=0 :ELSE leap.buf=1
IF mo>2 THEN rec=rec+leap.buf
IF mo=1 THEN rec=day:EXIT SUB
FOR x=1 TO mo-1:rec=rec+days.in.month(x):NEXT x
rec=rec+day
END SUB
SUB input.ps (px,py,length,word$) STATIC
SHARED flag
flag=0:LOCATE px,py:PRINT SPACE$(length);
no.input=0:c=5:p=1:GOSUB put.cursor
getke: a$=INKEY$
WHILE a$="":a$=INKEY$
IF MOUSE(0)<0 THEN exitsub
WEND
IF a$<CHR$(127) AND a$>CHR$(31) THEN
IF p>length THEN BEEP:GOTO getke
MID$(word$,p,1)=a$:LOCATE px,py:PRINT word$
p=p+1:c=5:GOSUB put.cursor
GOTO getke
END IF
IF a$=CHR$(127) THEN
LOCATE px,1:PRINT SPACE$(45)
flag=1
EXIT SUB
END IF
IF a$=CHR$(13) THEN
exitsub:
c=7:GOSUB put.cursor
EXIT SUB
END IF
IF a$=CHR$(8) THEN
IF p>1 THEN
IF p=>length THEN c=7:GOSUB put.cursor
p=p-1
word$=LEFT$(word$,p-1)+MID$(word$,p+1)+" "
LOCATE px,py:PRINT word$
c=5:GOSUB put.cursor:GOTO getke
ELSE
BEEP:GOTO getke
END IF
END IF
IF a$=CHR$(30) THEN
IF p>length THEN BEEP:GOTO getke
c=7:GOSUB put.cursor:p=p+1:c=5:GOSUB put.cursor
GOTO getke
END IF
IF a$=CHR$(31) THEN
IF p=1 THEN BEEP:GOTO getke
c=7:GOSUB put.cursor:p=p-1:c=5:GOSUB put.cursor
GOTO getke
END IF
BEEP:GOTO getke
put.cursor:
LINE((py+p-2)*8,(px-1)*8)-((py+p-2)*8,(px-1)*8+6),c
RETURN
END SUB
new.file: LSET c.dat$=SPACE$(300):LSET s.nam$=STRING$(10,0)
FOR x=1 TO 366:PUT 1:NEXT x
OPEN "cal.symbol.dat" AS 4 LEN=32
FIELD 4,32 AS cod$:LSET cod$=STRING$(32,0)
FOR x=1 TO 12:PUT 4:NEXT x
CLOSE 4
RETURN